package com.ytt.core.service.entity.student;


import com.ytt.core.service.entity.AbstractBaseEntity;
import com.ytt.core.service.entity.major.Major;
import com.ytt.core.service.entity.schoolClass.SchoolClass;
import com.ytt.core.service.entity.user.User;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

/**
 * 教师
 * @author chenwen
 * @date 2019/9/12 15:02
 */
@Entity
@Setter
@Getter
@Table(name = "sys_student")
public class Student  extends AbstractBaseEntity {

    /**
     * 学号
     * 唯一性
     */
    @Column(name = "student_id",unique = true)
    private String student_id;


    /**
     * 是否毕业
     * 毕业不允许登录
     */
    @Column(name = "is_graduation", nullable = false)
    private Boolean is_graduation = false;


    /**
     * 所属的专业
     */
    @ManyToOne(targetEntity = Major.class)
    @JoinColumn(name = "major_id")
    private Major major;



    /**
     * 年级
     */
    @Column(name = "grade", nullable = false,length = 4)
    private int grade ;

    /**
     * 所属的用户
     */
    @ManyToOne(targetEntity = User.class)
    @JoinColumn(name = "user_id")
    private User user;

}
